var app = getApp();

function duihuan(cdKey,success,fail){
  let data = {
    userId: app.globalData.userId,
    code: cdKey
  }
  app.func.Post(false, app.api.redeemcode, data, function (res) {
    typeof success == "function" && success(res)
  },function(res){
    typeof fail == "function" && fail(res)
  })
};
module.exports = {
  duihuan: duihuan,
};